package com.example.superoa.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the rplan database table.
 * 
 */
@Entity
@NamedQuery(name="Rplan.findAll", query="SELECT r FROM Rplan r")
public class Rplan implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int rplanid;

	@Temporal(TemporalType.TIMESTAMP)
	private Date rplanend;

	@Temporal(TemporalType.TIMESTAMP)
	private Date rplanexitend;

	private BigDecimal rplanexitmoney;

	@Temporal(TemporalType.TIMESTAMP)
	private Date rplanexitstart;

	private BigDecimal rplanmoney;

	private String rplanname;

	private String rplanplace;

	@Temporal(TemporalType.TIMESTAMP)
	private Date rplanstart;

	private String rplanway;

	private int rplanqi;
	//bi-directional many-to-one association to Rapply
	@OneToMany(mappedBy="rplan")
	private List<Rapply> rapplies;

	//bi-directional many-to-one association to Department
	@ManyToOne
	@JoinColumn(name="Depart_id")
	private Department department;

	//bi-directional many-to-one association to Position
	@ManyToOne
	@JoinColumn(name="position_id")
	private Position position;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="staff_id")
	private Staff staff;

	public Rplan() {
	}

	public int getRplanid() {
		return this.rplanid;
	}

	public void setRplanid(int rplanid) {
		this.rplanid = rplanid;
	}

	public Date getRplanend() {
		return this.rplanend;
	}

	public void setRplanend(Date rplanend) {
		this.rplanend = rplanend;
	}

	public Date getRplanexitend() {
		return this.rplanexitend;
	}

	public void setRplanexitend(Date rplanexitend) {
		this.rplanexitend = rplanexitend;
	}

	public BigDecimal getRplanexitmoney() {
		return this.rplanexitmoney;
	}

	public void setRplanexitmoney(BigDecimal rplanexitmoney) {
		this.rplanexitmoney = rplanexitmoney;
	}

	public Date getRplanexitstart() {
		return this.rplanexitstart;
	}

	public void setRplanexitstart(Date rplanexitstart) {
		this.rplanexitstart = rplanexitstart;
	}

	public BigDecimal getRplanmoney() {
		return this.rplanmoney;
	}

	public void setRplanmoney(BigDecimal rplanmoney) {
		this.rplanmoney = rplanmoney;
	}

	public String getRplanname() {
		return this.rplanname;
	}

	public void setRplanname(String rplanname) {
		this.rplanname = rplanname;
	}

	public String getRplanplace() {
		return this.rplanplace;
	}

	public void setRplanplace(String rplanplace) {
		this.rplanplace = rplanplace;
	}

	public Date getRplanstart() {
		return this.rplanstart;
	}

	public void setRplanstart(Date rplanstart) {
		this.rplanstart = rplanstart;
	}

	public String getRplanway() {
		return this.rplanway;
	}

	public void setRplanway(String rplanway) {
		this.rplanway = rplanway;
	}

	public List<Rapply> getRapplies() {
		return this.rapplies;
	}

	public void setRapplies(List<Rapply> rapplies) {
		this.rapplies = rapplies;
	}

	public Rapply addRapply(Rapply rapply) {
		getRapplies().add(rapply);
		rapply.setRplan(this);

		return rapply;
	}

	public Rapply removeRapply(Rapply rapply) {
		getRapplies().remove(rapply);
		rapply.setRplan(null);

		return rapply;
	}

	public Department getDepartment() {
		return this.department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public Position getPosition() {
		return this.position;
	}

	public void setPosition(Position position) {
		this.position = position;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public int getRplanqi() {
		return rplanqi;
	}

	public void setRplanqi(int rplanqi) {
		this.rplanqi = rplanqi;
	}
	
}